﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace PublisherManagementSystem.Models
{
	public class Publisher
	{
		public int PublisherID { get; set; }

		[Required(ErrorMessage = "出版社名称不能为空")]
		[Display(Name = "出版社名称")]
		[StringLength(100, ErrorMessage = "出版社名称不能超过100个字符")]
		public string PublisherName { get; set; }

		public int ProvinceID { get; set; }
		public int CityID { get; set; }
		public int DistrictID { get; set; }

		[Required(ErrorMessage = "详细地址不能为空")]
		[Display(Name = "详细地址")]
		[StringLength(200, ErrorMessage = "详细地址不能超过200个字符")]
		public string Address { get; set; }

		[Required(ErrorMessage = "联系人不能为空")]
		[Display(Name = "联系人")]
		[StringLength(50, ErrorMessage = "联系人姓名不能超过50个字符")]
		public string ContactPerson { get; set; }

		[Required(ErrorMessage = "联系电话不能为空")]
		[Display(Name = "联系电话")]
		[Phone(ErrorMessage = "请输入有效的电话号码")]
		[StringLength(20, ErrorMessage = "联系电话不能超过20个字符")]
		public string Phone { get; set; }

		[EmailAddress(ErrorMessage = "请输入有效的电子邮箱")]
		[Display(Name = "电子邮箱")]
		[StringLength(100, ErrorMessage = "电子邮箱不能超过100个字符")]
		public string Email { get; set; }

		// 导航属性
		public virtual Province Province { get; set; }
		public virtual City City { get; set; }
		public virtual District District { get; set; }
		public virtual ICollection<PublisherStaff> Staffs { get; set; }
	}
}

